// import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import AutoImport from "unplugin-auto-import/vite"
import {viteMockServe} from "vite-plugin-mock"
import path from 'path'
// https://vitejs.dev/config/
// export default defineConfig({
//   plugins: [
//     uni(),
// 	AutoImport({
// 		imports:["vue","uni-app","pinia"],
// 		dts:true,
// 	},),
// 	UnoCSS()
//   ],
// })
export default async ()=>{
	const UnoCSS = (await import('unocss/vite')).default
	
	return defineConfig({
		plugins:[
			uni(),
			AutoImport({
				imports:[
					"vue",
					"uni-app",
					"pinia",
					{
						'@/api':['useRequest'],
					},
				],
				dts:true,
			},),
			UnoCSS(),
			viteMockServe({
				mockPath:'mock',//mock文件存放的路径，默认是根目录下的mock文件夹
				supportTs:false,// 如果使用 TypeScript ，设置为true
			})
		],
	})
}